<h1 class="title">Tasks in <%= link_to @project.name, {:controller => 'project', :action => 'show', :id => @project.project_id } %></h1>

<table class="tabular" style="width: 80%">
 <tr class="header">
  <th>#</th>
  <th>Subject</th>
  <th>Priority</th>
  <th>Status</th>
  <th>Created</th>
  <th>Requestor</th>
  <th>Owner</th>
  <th>Time left</th>
  <th></th>
 </tr>
<% for task in @tasks %>
 <tr>
  <td><%= link_to task.task_id, { :controller => "task", :action => "show", :id => task.task_id }  %></td>
  <td><%= link_to task.subject, { :controller => "task", :action => "show", :id => task.task_id }  %></td>
  <td><%= task.priority %>/10</td>
  <td><%= task.status.name %></td>
  <td><%= task.created.strftime('%F %T') %></td>
  <td><%= task.requestor %></td>
  <td><% if task.user %><%= link_to task.user.username, {:controller => 'user', :action => 'show', :id => task.owner } %><% else %>Nobody<% end %></td>
  <td><%= task.estimated_time - task.time_worked %></td>
  <td><% if task.status_fk.to_i == 1 %><%= link_to 'Take', {:controller => 'task', :action => 'take', :id => task.task_id } %><% end %></td>
 </tr> 
<% end %>
</table>
